home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / Change / Change.doc < prev    next >
Encoding:
Text File  |  1998-08-04  |  2.9 KB  |  112 lines

  1.  
  2. Change V1.0
  3. ===========
  4.  
  5. Change alters a file by following commands given in another file. Patches
  6. can be described in a Change command file, avoiding the need for larger
  7. patch executables.
  8.  
  9.  
  10. Usage
  11. =====
  12.  
  13. change <source-file> <instruction-file>
  14.  
  15.  
  16. Command Files
  17. =============
  18.  
  19. These files give instructions on how to make changes to a file and can be
  20. entered via a file editor. Although this is awkward, most of the command
  21. files are very small. Also, if there is enough interest, a "compiler" may be
  22. written by myself or others. The commands are executed in order.
  23.  
  24.  
  25. Commands
  26. ========
  27.  
  28. Commands are 
  29.  
  30. General Structure:
  31. -----------------
  32.  
  33. <command(BYTE)> <offset/length(LONG)> [<sequence(offset/length BYTEs)>]
  34.  
  35.  
  36. GOTO(from start):        00 <offset(LONG)>
  37. ----------------
  38.  
  39. Sets the current position to the given absolute offset within the target
  40. file.
  41.  
  42. Example: 00 00000100 (go to the 256th byte of the target file)
  43.  
  44.  
  45. GOTO(from current pos):  01 <offset(LONG)>
  46. ----------------------
  47.  
  48. Moves the current position within the target file forward the given number
  49. of bytes (or backwards if negative).
  50.  
  51. Example: 01 FFFFFFF6 (go back 10 bytes in the target file)
  52.  
  53.  
  54. GOTO(from end):          02 <offset(LONG)>
  55. --------------
  56.  
  57. Moves to a position in the target file relative to the position just after
  58. the last byte of the file.
  59.  
  60. Example: 02 FFFFFFFE (go to the second-last byte of the target file)
  61.  
  62.  
  63. FIND:                    03 <length(LONG)> <sequence(<length> BYTEs)>
  64. ----
  65.  
  66. Searches for the next occurance of the given sequence within the target
  67. file and moves the current position to where it's found.
  68.  
  69. Example: 03 00000005 01 02 03 04 05 (find the numeric sequence 1,2,3,4,5)
  70.  
  71.  
  72. CHECK:                   04 <length(LONG)> <sequence(<length> BYTEs)>
  73. -----
  74.  
  75. Ensures that the given sequence occurs in the target file at the current
  76. position. Does not affect the current position.
  77.  
  78. Example: 04 00000003 03 02 01 (check that the numeric sequence 3,2,1 starts
  79.                                at the current position)
  80.  
  81.  
  82. WRITE:                   05 <length(LONG)> <sequence(<length> BYTEs)>
  83. -----
  84.  
  85. Writes the given sequence to the target file at the current position and
  86. moves the current position to the first byte after the written sequence.
  87.  
  88. Example: 05 00000004 00 00 00 00 (write four zero bytes starting at the
  89.                                   current position)
  90.  
  91. GOTO(from start):        00 <offset(LONG)>
  92. GOTO(from current pos):  01 <offset(LONG)>
  93. GOTO(from end):          02 <offset(LONG)>
  94. FIND:                    03 <length(LONG)> <sequence(<length> BYTEs)>
  95. CHECK:                   04 <length(LONG)> <sequence(<length> BYTEs)>
  96. WRITE:                   05 <length(LONG)> <sequence(<length> BYTEs)>
  97.  
  98.  
  99. Distribution
  100. ============
  101.  
  102. Change is freeware. It may be distributed freely as long as it is
  103. accompanied by this file.
  104.  
  105.  
  106. Bugs and Suggestions
  107. ====================
  108.  
  109. Send bug reports, suggestions etc. to:  Neil Cafferkey <caffer@cs.ucc.ie>
  110.  
  111.  
  112.